package bjtu.cit.bookshop.entities;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Note {
    private Integer id;

    private Integer userid;

    private String subject;

    private Date date1;

    private Integer employeeid;

    private Date date2;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject == null ? null : subject.trim();
    }

    public String getDate1() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(date1);
    }

    public void setDate1(Date date1) {
        this.date1 = date1;
    }

    public Integer getEmployeeid() {
        return employeeid;
    }

    public void setEmployeeid(Integer employeeid) {
        this.employeeid = employeeid;
    }

    public String getDate2() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        if (date2 == null) {
            return null;
        }
        return sdf.format(date2);
    }

    public void setDate2(Date date2) {
        this.date2 = date2;
    }
}